<template >
  <div >
    <mt-header :title="titles"></mt-header>

    <div class="login-content">
      <mt-field  label="用户名" placeholder="请输入用户名" v-model="username"></mt-field>
      <mt-field label="邮箱" placeholder="请输入邮箱" type="password" v-model="password"></mt-field>
      <div style="margin-top: 30px">
        <mt-button type="danger" size="large" @click.native="login">登录</mt-button>
      </div>
    </div>

  </div>
</template>
<script>
  export default{
    props:{
      titles:{
        type:String,
        default:'用户登陆',
      }
    },
    data(){
      return {
        username:'i an jus',
        password:'',
      }
    },
    methods:{
      login:function (event) {
        //console.log(this.$router.push('home'));
       // console.log(this.$http.get);
        this.$http.post('http://localhost:83/admin/index/login',
          {username:this.username,password:this.password})
        .then(res=>{
          this.$router.push('home');
        })
      },
    }
  }

</script>
<style lang="css">
  .login-content{
    margin-top: 60px;
  }
</style>